// run: $exec < input
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <queue>

template <class T>
struct dinic
{
	typedef T value_type;
	typedef int size_type;
	typedef std::vector<size_type>::iterator edge_iter;

	struct edge {
		size_type from, to;
		value_type capacity, flow;
	};

	dinic(size_type num) : size(num)
	{
		graph.resize(num);	//[0, num)
		dist.resize(num);	//[0, num)
	}

	void add_edge(int u, int v, value_type cap = capacity_inf)
	{
		edge tmp;
		tmp.from = u; tmp.to = v; tmp.capacity = cap; tmp.flow = 0;
		edges.push_back(tmp);
		graph[u].push_back(edges.size() - 1);

		tmp.from = v; tmp.to = u; tmp.capacity = 0; tmp.flow = 0;
		edges.push_back(tmp);
		graph[v].push_back(edges.size() - 1);
	}

	bool bfs_label(size_type source, size_type target)
	{
		std::fill(dist.begin(), dist.end(), -1);
		std::queue<size_type> q;
		q.push(source);
		dist[source] = 0;
		while (!q.empty()) {
			size_type now = q.front();
			q.pop();
			for (edge_iter it = graph[now].begin(); it != graph[now].end(); ++it) {
				edge e = edges[*it];
				if (dist[e.to] == -1 && e.capacity > e.flow) {
					q.push(e.to);
					dist[e.to] = dist[now] + 1;
				}
			}
		}
		return dist[target] != -1;
	}

	value_type dfs(size_type v, size_type target, value_type f)
	{
		if (v == target || !f) return f;
		value_type block_flow = 0;
		for (edge_iter it = graph[v].begin(); it != graph[v].end(); ++it) {
			edge & e = edges[*it];
			if (e.capacity > e.flow && dist[e.to] == dist[v] + 1) {
				value_type tmp = dfs(e.to, target,
						std::min(e.capacity - e.flow, f - block_flow));
				block_flow += tmp;
				e.flow += tmp;
				edges[(*it) ^ 1].flow -= tmp;
			}
		}
		if (!block_flow) dist[v] = -1;
		return block_flow;
	}

	value_type max_flow(size_type source, size_type target)
	{
		value_type flow = 0;
		for (int tmp; bfs_label(source, target); )
			while ((tmp = dfs(source, target, capacity_inf))) flow += tmp;
		return flow;
	}

//private:
	value_type static const capacity_inf = std::numeric_limits<value_type>::max();
	size_type size;
	std::vector<int> dist;
	std::vector<edge> edges;
	std::vector<std::vector<size_type>> graph;
};

struct edge { int x, y; long long z; };
int n, m, x;
std::vector<edge> da;
double const eps = 1e-13;
dinic<long long> d(50 + 5);

bool judge(double mid)
{
	for (int i = 4; i < (int)d.edges.size(); i += 2) {
		if (mid < eps)
			d.edges[i].capacity = d.capacity_inf;
		else
			d.edges[i].capacity = da[(i-4) / 2].z / mid;
		d.edges[i].flow = d.edges[i ^ 1].flow = 0;
	}
	d.edges[0].flow = d.edges[1].flow = d.edges[2].flow = d.edges[3].flow = 0;
	return d.max_flow(0, n + 1) == x;
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> m >> x;
	da.resize(m);
	d.add_edge(0, 1, x);
	d.add_edge(n, n + 1, x);
	for (int i = 0; i < m; i++) {
		std::cin >> da[i].x >> da[i].y >> da[i].z;
		d.add_edge(da[i].x, da[i].y, da[i].z);
	}
	double l = 0, r = 1000000;
	for (int i = 0; i < 200; i++) {
	//while (l + eps < r) {
		double mid = (l + r) / 2.0;
		if (judge(mid)) l = mid;
		else r = mid;
	}
	std::cout << std::fixed << std::setprecision(8) << l * x << '\n';
}

